import { defineStore } from 'pinia'
import { EditClassification } from '../utils/trueType'
export const useEditClassificationStore = defineStore('EditClassification', {
    state: () => ({
        EditRufrom:{
            categoryId: null,
            category: '',
            categoryIsDeactivate: 0,
            subcategoryId: '',
            subcategory: '',
            subcategoryIsDeactivate: 0
        } as EditClassification,
        isOpen: false,
        subcategoryIsOpen: false,
        submit:  false
    }),
    actions: {
        changeIsOpen(isOpen: boolean) {
            this.isOpen = isOpen
        },
        changeSubcategoryIsOpen(isOpen: boolean) {
            this.subcategoryIsOpen = isOpen
        },
        setEditFromNull(){
            this.EditRufrom = {
                categoryId: null,
                category: '',
                categoryIsDeactivate: 0,
                subcategoryId: '',
                subcategory: '',
                subcategoryIsDeactivate: 0
            } as EditClassification
        },
        changeSubmit(submit: boolean) {
            this.submit = submit
        }
    },
    getters: {
        
    },
}
)